#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;

class Solution {
public:
    int findMin(vector<int>& nums) {
        int left = 0, right = nums.size() - 1;
        while (left < right)
        {
            int mid = left + (right - left + 1) / 2;
            if (nums[mid] >= nums[0]) left = mid;
            else if (nums[mid] < nums[0]) right = mid - 1;
        }
        return nums[(left + 1) % nums.size()];
    }
};

int main()
{
    return 0;
}